import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:getwidget/colors/gf_color.dart';
import 'package:getwidget/components/image/gf_image_overlay.dart';

import '../controllers/gfimage_controller.dart';

class GfimageView extends GetView<GfimageController> {
  String avatarUrl = 'https://i0.hdslb.com/bfs/face/d857929b564a8aa7c63ac40b32f952841928e2d9.jpg@128w_128h_1o.webp';
  String avatarPath = 'assets/images/cliu.jpg';
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('图片'),
        centerTitle: true,
      ),
      body: Container(
        child: ListView(
          children: [
            Wrap(
              alignment: WrapAlignment.center,
              children: [
                GFImageOverlay(
                  height: 200,
                  width: 300,
                  image: AssetImage(avatarPath)
                ),
                GFImageOverlay(
                  height: 300,
                  width: 200,
                  image: NetworkImage(avatarUrl),
                ),
                GFImageOverlay(
                  height: 200,
                  width: 300,
                  child: Center(
                    child: Text(
                      '初六', 
                      style:TextStyle(
                        color: GFColors.WARNING,
                        fontSize: 50
                      )
                    ),
                  ),
                  image: AssetImage(avatarPath),
                  colorFilter: new ColorFilter.mode(
                    Colors.black.withOpacity(0.5),
                    BlendMode.darken
                  ),
                ),
                GFImageOverlay(
                  height: 200,
                  width: 200,
                  shape: BoxShape.circle,
                  image:AssetImage(avatarPath),
                  boxFit: BoxFit.cover,
                )
              ],
            )
          ],
        ),
      ),
    );
  }
}
